<?php
require_once 'XB/Loader/Abstract.php';

class XB_Loader_One extends XB_Loader_Abstract{
	private static $_instance;
	
	public static function getInstance($tag,$path){
		if (null === self::$_instance) {
            self::$_instance = new self($tag,$path);
        }
        return self::$_instance;
	}
	
	public function autoLoad($className){
		$classPath = str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
        foreach ($this->_paths as $path) {
            if (file_exists($path . $classPath)) {
                require $path . $classPath;
            }
        }
	}
	
	private function __construct($tag,$path){
		$this->addPath($tag, $path);
		$this->setAutoloadRegister($this, 'autoLoad');
	}
}

?>